<%--
  Created by IntelliJ IDEA.
  User: fujia
  Date: 2016/5/25
  Time: 11:25
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="s" uri="/struts-tags" %>

<!doctype html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="lt-ie9 lt-ie8" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="lt-ie9" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en-US"> <!--<![endif]-->
<%@include file="common/head.jsp"%>

<body>

    <%@include file="common/nav.jsp"%>

    <!-- Start of Page Container -->
    <div class="page-container">
        <div class="container">
            <div class="row">

                <!-- start of page content -->
                <div class="span8 page-content">


                    <%--分类 开始--%>
                    <ul class="breadcrumb">
                        <li><a href="#">Knowledge Base Theme</a><span class="divider">/</span></li>
                        <li class="active"><s:property value="#session.blockName" /></li>
                    </ul>
                    <%--分类 结束--%>

                    <s:iterator value="#session.single" status="single">
                        <%--文章 开始--%>
                        <article class=" type-post format-standard hentry clearfix">
                            <h1 class="post-title"><a href="#"><s:property value="title" /></a></h1>
                            <div class="post-meta clearfix">
                                <span class="date"><s:property value="dateAdded" /></span>
                                <span class="category"><a href="#"><s:property value="#session.blockName" /></a></span>
                                <span class="comments"><a href="#"><span><s:property value="commentNumber" /></span><b>条评论</b></a></span>
                                <span class="like-count"><s:property value="praiseNumber" /></span>
                            </div><!-- end of post meta -->
                            <p><s:property value="text" /></p>
                        </article>
                        <%--文章 结束--%>

                        <%--点赞 开始--%>
                        <div class="like-btn">
                            <form id="like-it-form" action="#" method="post" >
                                <span class="single-like-it"><s:property value="praiseNumber" /></span>
                            </form>
                            <span class="tags">
                                <strong>Tags:&nbsp;&nbsp;</strong><a href="#" rel="tags"><s:property value="tags" /></a>
                            </span>
                        </div>
                        <%--点赞 结束--%>
                    </s:iterator>

                    <section id="comments">


                        <h3 id="comments-title"><span>(<s:property value="#session.single.commentNumber" />)</span><b>条评论</b></h3>

                        <%--评论内容 开始--%>
                        <ol class="commentlist">
                            <s:iterator value="#session.replys" status="reply">
                                <%--回复 开始--%>
                                <li class="comment even thread-even depth-1">
                                    <article>
                                        <a href="#">
                                            <img alt="img" src="/resources/picture/head/<s:property value="userId" />.png" class="avatar avatar-60 photo" height="60" width="60">
                                        </a>
                                        <div class="comment-meta">
                                            <h5 class="author">
                                                <cite class="fn">
                                                    <a href="#" rel="external nofollow" class="url"><s:property value="username" /></a>
                                                </cite>
                                                - <a class="comment-reply-link" href="#">Reply</a>
                                            </h5>
                                            <p class="date">
                                                <a href="#">
                                                    <time><s:property value="date" /> at <s:property value="time" /></time>
                                                </a>
                                            </p>
                                        </div>
                                        <div class="comment-body">
                                            <p><s:property value="text" /></p>
                                        </div>
                                    </article>
                                </li>
                                <%--回复 结束--%>
                            </s:iterator>
                        </ol>
                        <%--评论内容 结束--%>

                        <%--回复 开始--%>
                        <div id="respond">

                            <h3>留下回复</h3>

                            <div class="cancel-comment-reply">
                                <a rel="nofollow" id="cancel-comment-reply-link" href="#" style="display:none;">点击这里取消回复。</a>
                            </div>

                            <s:if test="#session.username != '' && #session.userId != null && #session.single != null">
                                <form action="/post/single.action?article=<s:property value="#session.single.articleId" />" method="post" id="commentform">

                                    <div>
                                        <label for="comment">评论</label>
                                        <textarea class="span8" name="comment" id="comment" cols="58" rows="10"></textarea>
                                        <input type="hidden" name="userId" value="<s:property value="#session.userId" />">
                                        <input type="hidden" name="blockId" value="<s:property value="#session.single.articleId" />">
                                    </div>

                                    <div>
                                        <input class="btn" name="submit" type="submit" id="submit"  value="提交评论">
                                    </div>

                                </form>
                            </s:if>
                            <s:else>
                                <p class="comment-notes">请先登录，才能进行评论<span class="required">*</span></p>
                            </s:else>

                        </div>
                        <%--回复 结束--%>

                    </section>

                </div>
                <!-- end of page content -->

                <%@include file="common/aside.jsp"%>

            </div>
        </div>
    </div>
    <!-- End of Page Container -->

    <%@include file="common/foot.jsp"%>

    <a href="#top" id="scroll-top"></a>

    <%@include file="common/script.jsp"%>

</body>

</html>